//## begin module%3B8802650381.cm preserve=no
//	  %X% %Q% %Z% %W%
//## end module%3B8802650381.cm

//## begin module%3B8802650381.cp preserve=no
//	+----------------------------------------------+
//	| SVMBR - A program for training SVMs          |
//	+----------------------------------------------+
//	| * Creator, modeling, coding:                 |
//	|    Marcelo Barros de Almeida                 |
//	|    barros@smar.com.br                        |
//	|    http://litc.cpdee.ufmg.br/~barros/        |
//	| * Coding, improvements, bug fixes:           |
//	|    Bernardo Penna                            |
//	|    bprc@brfree.com.br                        |
//	+----------------------------------------------+
//
//	 Copyright(c) 2002 by Marcelo Barros de Almeida
//	                            All rights reserved
//
//	-[CVS]------------------------------------------
//	$Author$
//	$Date$
//	$Source$
//	$Name$
//	$Revision$
//	------------------------------------------------
//## end module%3B8802650381.cp

//## Module: solver%3B8802650381; Package specification
//## Subsystem: <Top Level>
//## Source file: D:\textotese\svmbr\src\solver.h

#ifndef solver_h
#define solver_h 1

//## begin module%3B8802650381.additionalIncludes preserve=no
//## end module%3B8802650381.additionalIncludes

//## begin module%3B8802650381.includes preserve=yes
//## end module%3B8802650381.includes

// cache
#include "cache.h"
// cronometer
#include "cronometer.h"
// data
#include "data.h"
// kernel
#include "kernel.h"
// global
#include "global.h"

class SVM;

//## begin module%3B8802650381.declarations preserve=no
//## end module%3B8802650381.declarations

//## begin module%3B8802650381.additionalDeclarations preserve=yes
class Cache;
//## end module%3B8802650381.additionalDeclarations


//## begin Solver%3B87FD370399.preface preserve=yes
//## end Solver%3B87FD370399.preface

//## Class: Solver%3B87FD370399
//## Category: QP Solver package%3B88052B0288
//## Subsystem: <Top Level>
//## Persistence: Transient
//## Cardinality/Multiplicity: n

class Solver 
{
  //## begin Solver%3B87FD370399.initialDeclarations preserve=yes
  //## end Solver%3B87FD370399.initialDeclarations

  public:

    //## Other Operations (specified)
      //## Operation: evalOutput%998688348
      REAL evalOutput (UINT i1);

      //## Operation: evalKernel%998688351
      REAL evalKernel (UINT i1, UINT i2);

      //## Operation: saveResult%998688352
      INT saveResult (CHAR *file);

      //## Operation: run%998688363
      virtual INT run (INT maxi) = 0;

      //## Operation: run%998880781
      virtual INT run () = 0;

      //## Operation: run_chunck%998688364
      virtual INT run_chunck (INT maxi) = 0;

      //## Operation: run_chunck%998880782
      virtual INT run_chunck () = 0;

      //## Operation: getalpha%998880796
      REAL getalpha (INT i1) const;

      //## Operation: getepsilon%998880797
      REAL getepsilon () const;

      //## Operation: gettol%999139397
      REAL gettol () const;

      //## Operation: getC%998880798
      REAL getC () const;

      //## Operation: getbias%998880799
      REAL getbias () const;

      //## Operation: calcBias%999084993
      VOID calcBias ();

      //## Operation: getElapsedTime%999139393
      REAL getElapsedTime ();

      //## Operation: getnumIter%999139395
      INT getnumIter () const;

      //## Operation: init%1000125175
      VOID init (REAL cv, REAL tolv, REAL epsilonv, SVM *svmp, Kernel *kernelp, Data *datap, INT chunksizev);

      //## Operation: freeSpace%1000125176
      VOID freeSpace ();

      //## Operation: UsingChunk%1013528657
      INT UsingChunk ();

    // Data Members for Class Attributes

      //## Attribute: EDR%3B882D530009
      //## begin Solver::EDR%3B882D530009.attr preserve=no  public: static SHORT {U} 1
      static SHORT EDR;
      //## end Solver::EDR%3B882D530009.attr

      //## Attribute: SMO%3B882D5F03C8
      //## begin Solver::SMO%3B882D5F03C8.attr preserve=no  public: static SHORT {U} 2
      static SHORT SMO;
      //## end Solver::SMO%3B882D5F03C8.attr

      //## Attribute: BOOSTING%3BA9FF510196
      //## begin Solver::BOOSTING%3BA9FF510196.attr preserve=no  public: static SHORT {UA} 3
      static SHORT BOOSTING;
      //## end Solver::BOOSTING%3BA9FF510196.attr

    // Additional Public Declarations
      //## begin Solver%3B87FD370399.public preserve=yes
      //## end Solver%3B87FD370399.public

  protected:
    // Data Members for Class Attributes

      //## Attribute: epsilon%3B880EC00004
      //## begin Solver::epsilon%3B880EC00004.attr preserve=no  protected: REAL {UA} 
      REAL epsilon;
      //## end Solver::epsilon%3B880EC00004.attr

      //## Attribute: tol%3B880EC402BD
      //## begin Solver::tol%3B880EC402BD.attr preserve=no  protected: REAL {UA} 
      REAL tol;
      //## end Solver::tol%3B880EC402BD.attr

      //## Attribute: C%3B880EC901FC
      //## begin Solver::C%3B880EC901FC.attr preserve=no  protected: REAL {UA} 
      REAL C;
      //## end Solver::C%3B880EC901FC.attr

      //## Attribute: alpha%3B880EE9000D
      //## begin Solver::alpha%3B880EE9000D.attr preserve=no  protected: REAL * {UA} 
      REAL *alpha;
      //## end Solver::alpha%3B880EE9000D.attr

      //## Attribute: bias%3B880F010062
      //## begin Solver::bias%3B880F010062.attr preserve=no  protected: REAL {UA} 
      REAL bias;
      //## end Solver::bias%3B880F010062.attr

      //## Attribute: numIter%3B880FA50144
      //## begin Solver::numIter%3B880FA50144.attr preserve=no  protected: UINT {UA} 
      UINT numIter;
      //## end Solver::numIter%3B880FA50144.attr

      //## Attribute: errorCache%3B8AF704037E
      //## begin Solver::errorCache%3B8AF704037E.attr preserve=no  protected: REAL * {UA} 
      REAL *errorCache;
      //## end Solver::errorCache%3B8AF704037E.attr

      //## Attribute: crono%3B8CD3FD015F
      //## begin Solver::crono%3B8CD3FD015F.attr preserve=no  protected: Cronometer {UA} 
      Cronometer crono;
      //## end Solver::crono%3B8CD3FD015F.attr

      //## Attribute: examineAll%3B8FE051004B
      //## begin Solver::examineAll%3B8FE051004B.attr preserve=no  protected: SHORT {UA} 
      SHORT examineAll;
      //## end Solver::examineAll%3B8FE051004B.attr

      //## Attribute: cache%3B94EAAF0060
      //## begin Solver::cache%3B94EAAF0060.attr preserve=no  protected: Cache * {UA} 
      Cache *cache;
      //## end Solver::cache%3B94EAAF0060.attr

      //## Attribute: subset%3C69401E01DF
      //## begin Solver::subset%3C69401E01DF.attr preserve=no  protected: INT * {UA} 
      INT *subset;
      //## end Solver::subset%3C69401E01DF.attr

      //## Attribute: supset%3C69402403D2
      //## begin Solver::supset%3C69402403D2.attr preserve=no  protected: INT * {UA} 
      INT *supset;
      //## end Solver::supset%3C69402403D2.attr

      //## Attribute: oldAlphaSubset%3C69402F0107
      //## begin Solver::oldAlphaSubset%3C69402F0107.attr preserve=no  protected: REAL * {UA} 
      REAL *oldAlphaSubset;
      //## end Solver::oldAlphaSubset%3C69402F0107.attr

      //## Attribute: oldBiasSubset%3C69403A0320
      //## begin Solver::oldBiasSubset%3C69403A0320.attr preserve=no  protected: REAL {UA} 
      REAL oldBiasSubset;
      //## end Solver::oldBiasSubset%3C69403A0320.attr

      //## Attribute: chunkSize%3C6940460074
      //## begin Solver::chunkSize%3C6940460074.attr preserve=no  protected: INT {UA} 
      INT chunkSize;
      //## end Solver::chunkSize%3C6940460074.attr

    // Data Members for Associations

      //## Association: SVM package::<unnamed>%3B88115D0024
      //## Role: Solver::svm%3B88115E004E
      //## begin Solver::svm%3B88115E004E.role preserve=no  protected: SVM { -> RFHAN}
      SVM *svm;
      //## end Solver::svm%3B88115E004E.role

      //## Association: SVM package::<unnamed>%3B8AEE1B0003
      //## Role: Solver::kernel%3B8AEE1B023E
      //## begin Solver::kernel%3B8AEE1B023E.role preserve=no  protected: Kernel { -> RHGAN}
      Kernel *kernel;
      //## end Solver::kernel%3B8AEE1B023E.role

      //## Association: SVM package::<unnamed>%3B8AF88C01DD
      //## Role: Solver::data%3B8AF88D00D0
      //## begin Solver::data%3B8AF88D00D0.role preserve=no  protected: Data { -> RHGAN}
      Data *data;
      //## end Solver::data%3B8AF88D00D0.role

    // Additional Protected Declarations
      //## begin Solver%3B87FD370399.protected preserve=yes
      //## end Solver%3B87FD370399.protected

  private:
    // Additional Private Declarations
      //## begin Solver%3B87FD370399.private preserve=yes
      //## end Solver%3B87FD370399.private

  private: //## implementation
    // Additional Implementation Declarations
      //## begin Solver%3B87FD370399.implementation preserve=yes
      //## end Solver%3B87FD370399.implementation

};

//## begin Solver%3B87FD370399.postscript preserve=yes
//## end Solver%3B87FD370399.postscript

// Class Solver 


//## Other Operations (inline)
inline REAL Solver::getalpha (INT i1) const
{
  //## begin Solver::getalpha%998880796.body preserve=yes
	return alpha[i1];
  //## end Solver::getalpha%998880796.body
}

inline REAL Solver::getepsilon () const
{
  //## begin Solver::getepsilon%998880797.body preserve=yes
	return epsilon;
  //## end Solver::getepsilon%998880797.body
}

inline REAL Solver::gettol () const
{
  //## begin Solver::gettol%999139397.body preserve=yes
	return tol;
  //## end Solver::gettol%999139397.body
}

inline REAL Solver::getC () const
{
  //## begin Solver::getC%998880798.body preserve=yes
	return C;
  //## end Solver::getC%998880798.body
}

inline REAL Solver::getbias () const
{
  //## begin Solver::getbias%998880799.body preserve=yes
	return bias;
  //## end Solver::getbias%998880799.body
}

inline INT Solver::getnumIter () const
{
  //## begin Solver::getnumIter%999139395.body preserve=yes
	return numIter;
  //## end Solver::getnumIter%999139395.body
}

inline INT Solver::UsingChunk ()
{
  //## begin Solver::UsingChunk%1013528657.body preserve=yes
	if(data->getnumExamples() == chunkSize) 
		return FALSE; 
	else 
		return TRUE;
  //## end Solver::UsingChunk%1013528657.body
}

//## begin module%3B8802650381.epilog preserve=yes
//## end module%3B8802650381.epilog


#endif
